package com.example.mvp.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.PointerIcon;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public abstract class MultipleAdapter<DATA> extends BaseAdapter<DATA>{
    private CommType<DATA> commType;
    protected int type=-1;
    protected Context context;
    public MultipleAdapter(List<DATA> datas, Context context, CommType<DATA> commType) {
        super(datas, context, 0);
        this.commType=commType;
        this.context=context;
    }

    @Override
    public int getItemViewType(int position) {
        type = commType.getType(position,datas.get(position));
        return type;

    }


    @Override
    public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        int typeLayout = commType.getTypeLayout(viewType);
        return new BaseViewHolder(layoutInflater.inflate(typeLayout,parent,false));
    }
//
//    @Override
//    protected void bindData(BaseViewHolder holder, DATA data) {
//
//    }




}
